Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: handle id/ref in json #35 #36

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

andifreed
Copy link

This is how we solved the problem with microsofts $id/$ref graph reduction strategy. We basically replaced the objects with $ref with the referenced object. It also permits us to use the same navigation for json schema's id $ref.

Copy link

@yeshvantbhavnasi yeshvantbhavnasi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

changes looks good.

@andifreed
Copy link
Author

Crap, this isn't quite right, as the json schema example should merge the $ref as there are other properties that are might be there in the supplied example "required" : true.

So need to explore -- can I always merge (dropping the $ref) or only merge if there are unmatched properties (in the schema use case both will have "type" : "object" and match "id" to "$ref").

it weird that Object.create did not copy the attributes
but this produced the desired results.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants